﻿/*  
 *  IIS LogFile Analyser, Copyright (C) 2013. http://www.iis-analyser.com
 *  --
 *  This program is free software, provided "AS IS" WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
 * 
 *  File Author: Ian Quigley,    2013-02-23
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;

namespace DataStore
{
    internal class Database : IDisposable
    {
        internal static string DbFile;
        internal SQLiteConnection Connection;

        public static string DataSource { get; set; }
        
        public static Database Open()
        {
            var db = new Database();
            db.Connection = new SQLiteConnection( "Data Source=" + DbFile );
            
            return db;
        }

        public void Dispose()
        {
            if (Connection == null)
                return;

            Connection.Close();
            Connection.Dispose();            
        }

        
    }
}
